Skip to content

Don't throw error if user cancels out of choosing a language#2365

Merged
shati-patel merged 1 commit intomainfrom
shati-patel/exception
Apr 21, 2023
Merged

Don't throw error if user cancels out of choosing a language#2365
shati-patel merged 1 commit intomainfrom
shati-patel/exception

Conversation

@shati-patel
Copy link
Copy Markdown
Contributor

Small tweak: When running "Create Query", if the user escapes out of the language quickpick we don't need to throw an error. Instead we can just show a UserCancellationException notice.

Checklist

N/A—this is still behind a feature-flag.

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

When running "Create Query", if the user escapes out of the language quickpick we don't need to throw an error. Instead we can just show a `UserCancellationException` notice.
@shati-patel shati-patel requested a review from a team as a code owner April 20, 2023 16:19
@shati-patel shati-patel marked this pull request as draft April 20, 2023 16:31
@shati-patel shati-patel marked this pull request as ready for review April 20, 2023 16:32
Copy link
Copy Markdown
Contributor

@robertbrignull robertbrignull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I've tried it out and the experience is a lot nicer when you cancel the wizard. Thanks for spotting that and addressing it!

});

return await askForLanguage(this.cliServer, false);
return await askForLanguage(this.cliServer, true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That throwOnEmpty argument is confusingly named, but that's not the fault of this PR 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree! To me, it's something more like "always throw, but less aggressively" 🙃

I'll leave it as-is for now though.

@shati-patel shati-patel enabled auto-merge (squash) April 20, 2023 16:48
@shati-patel shati-patel merged commit 5fb0016 into main Apr 21, 2023
@shati-patel shati-patel deleted the shati-patel/exception branch April 21, 2023 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants